import request from '@/utils/request'

export const userApi = {
  // 获取用户列表（支持分页）
  getUsers: (page = 1, size = 10) => request.get('/blog-admin/sys/users', {
    params: { page, size }
  }),
  
  // 获取单个用户
  getUser: (id) => request.get(`/blog-admin/sys/users/${id}`),
  
  // 创建用户
  createUser: (data) => request.post('/blog-admin/sys/users', data),
  
  // 更新用户
  updateUser: (id, data) => request.put(`/blog-admin/sys/users/${id}`, data),
  
  // 删除用户
  deleteUser: (id) => request.delete(`/blog-admin/sys/users/${id}`)
}